package ThreadPool.lagou.concurrent.countDownLatch.demo01;

import java.util.concurrent.CountDownLatch;

/**
 * @param
 * @author oyz
 * @version 1.0.4
 * @description: 主线程
 * @date 2022/10/5 15:31
 */
public class Main {


    public static void main(String[] args) {
        CountDownLatch latch = new CountDownLatch(5);
        for (int i = 0; i < 4; i++) {
            new MyThread("线程"+(i+1),latch).start();
        }
        try {
            latch.await();
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        System.out.println("主线程结束");

    }
}
